@use "sass:math";

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.5);
  overflow-y: hidden;
}

.overlay__content {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.overlay__body {
  @extend %modal;
  display: flex;
  flex-wrap: wrap;
  flex-flow: column;
  max-height: 80%;
  max-width: 80%;
  position: relative;
  padding-bottom: #{math.div(12, $base-font-size)}rem;

  @media (max-width: 650px) {
    max-width: 100%;
    max-height: 100%;
    height: 100vh;
    width: 100vw;
  }
}

.overlay__body:has(.collection-create){
  max-height: none;
}

.overlay__header {
  display: flex;
  justify-content: space-between;
  padding: #{math.div(20, $base-font-size)}rem;
}

.overlay__actions {
  display: flex;
}

.overlay__actions-mobile {
  padding-left: #{math.div(24, $base-font-size)}rem;
}

.overlay__title {
  font-size: #{math.div(21, $base-font-size)}rem;
}

.overlay__close-button {
  @include icon();
  padding: #{math.div(3, $base-font-size)}rem 0 #{math.div(3, $base-font-size)}rem;
}

/* Fixed height overlay */
.overlay--is-fixed-height .overlay__body {
  height: 100vh;
}

.overlay--is-fixed-height .overlay__header {
  flex: 0;
}
